Cocktail Help Reference
GetEnumerator Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > WeakRefDictionary<TKey,TValue> Class : GetEnumerator Method



Glossary Item Box

Gets an enumerator over the values in the dictionary.

Syntax

Visual Basic (Declaration) 
Public Function GetEnumerator() As IEnumerator(Of KeyValuePair(Of TKey,TValue))
Visual Basic (Usage)Copy Code
Dim instance As WeakRefDictionary(Of TKey,TValue)
Dim value As IEnumerator(Of KeyValuePair(Of TKey,TValue))
 
value = instance.GetEnumerator()
C# 
public IEnumerator<KeyValuePair<TKey,TValue>> GetEnumerator()
C++/CLI 
public:
IEnumerator<KeyValuePair<TKey^,TValue^>>^ GetEnumerator(); 

Return Value

The enumerator.

Remarks

As objects are discovered and returned from the enumerator, a strong reference is temporarily held on the object so that it will continue to exist for the duration of the enumeration. Once the enumeration of that object is over, the strong reference is removed. If you wish to keep values alive for use after enumeration, to ensure that they stay alive, you should store strong references to them during enumeration.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.